﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;



public class TaskCondition
{
    public string id;
    public int nowAmount;
    public int targetAmount;
    public bool isFinish =false;
    public TaskCondition(
        string _id, int _nowAmount, int _targetAmount,bool _isFinsh)
    {
        this.id = _id;
        this.nowAmount = _nowAmount;
        this.targetAmount = _targetAmount;
        this.isFinish = _isFinsh;
    }
    public void Check(string id,int amount)
    {
        if (id==this.id)
        {
            nowAmount += amount;
            if (nowAmount >= targetAmount)
                isFinish = true;
            else
                isFinish = false;
        }
    }

}